Integrand size = 21, antiderivative size = 157 \[ \int \frac {\sec ^4(c+d x)}{a+b \cos (c+d x)} \, dx=\frac {2 b^4 \arctan \left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{a^4 \sqrt {a-b} \sqrt {a+b} d}-\frac {b \left (a^2+2 b^2\right ) \text {arctanh}(\sin (c+d x))}{2 a^4 d}+\frac {\left (2 a^2+3 b^2\right ) \tan (c+d x)}{3 a^3 d}-\frac {b \sec (c+d x) \tan (c+d x)}{2 a^2 d}+\frac {\sec ^2(c+d x) \tan (c+d x)}{3 a d} \]
[Out]
Time = 0.64 (sec) , antiderivative size = 157, normalized size of antiderivative = 1.00, number of steps used = 7, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.286, Rules used = {2881, 3134, 3080, 3855, 2738, 211} \[ \int \frac {\sec ^4(c+d x)}{a+b \cos (c+d x)} \, dx=\frac {2 b^4 \arctan \left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{a^4 d \sqrt {a-b} \sqrt {a+b}}-\frac {b \tan (c+d x) \sec (c+d x)}{2 a^2 d}-\frac {b \left (a^2+2 b^2\right ) \text {arctanh}(\sin (c+d x))}{2 a^4 d}+\frac {\left (2 a^2+3 b^2\right ) \tan (c+d x)}{3 a^3 d}+\frac {\tan (c+d x) \sec ^2(c+d x)}{3 a d} \]
[In]
[Out]
Rule 211
Rule 2738
Rule 2881
Rule 3080
Rule 3134
Rule 3855
Rubi steps \begin{align*} \text {integral}& = \frac {\sec ^2(c+d x) \tan (c+d x)}{3 a d}+\frac {\int \frac {\left (-3 b+2 a \cos (c+d x)+2 b \cos ^2(c+d x)\right ) \sec ^3(c+d x)}{a+b \cos (c+d x)} \, dx}{3 a} \\ & = -\frac {b \sec (c+d x) \tan (c+d x)}{2 a^2 d}+\frac {\sec ^2(c+d x) \tan (c+d x)}{3 a d}+\frac {\int \frac {\left (2 \left (2 a^2+3 b^2\right )+a b \cos (c+d x)-3 b^2 \cos ^2(c+d x)\right ) \sec ^2(c+d x)}{a+b \cos (c+d x)} \, dx}{6 a^2} \\ & = \frac {\left (2 a^2+3 b^2\right ) \tan (c+d x)}{3 a^3 d}-\frac {b \sec (c+d x) \tan (c+d x)}{2 a^2 d}+\frac {\sec ^2(c+d x) \tan (c+d x)}{3 a d}+\frac {\int \frac {\left (-3 b \left (a^2+2 b^2\right )-3 a b^2 \cos (c+d x)\right ) \sec (c+d x)}{a+b \cos (c+d x)} \, dx}{6 a^3} \\ & = \frac {\left (2 a^2+3 b^2\right ) \tan (c+d x)}{3 a^3 d}-\frac {b \sec (c+d x) \tan (c+d x)}{2 a^2 d}+\frac {\sec ^2(c+d x) \tan (c+d x)}{3 a d}+\frac {b^4 \int \frac {1}{a+b \cos (c+d x)} \, dx}{a^4}-\frac {\left (b \left (a^2+2 b^2\right )\right ) \int \sec (c+d x) \, dx}{2 a^4} \\ & = -\frac {b \left (a^2+2 b^2\right ) \text {arctanh}(\sin (c+d x))}{2 a^4 d}+\frac {\left (2 a^2+3 b^2\right ) \tan (c+d x)}{3 a^3 d}-\frac {b \sec (c+d x) \tan (c+d x)}{2 a^2 d}+\frac {\sec ^2(c+d x) \tan (c+d x)}{3 a d}+\frac {\left (2 b^4\right ) \text {Subst}\left (\int \frac {1}{a+b+(a-b) x^2} \, dx,x,\tan \left (\frac {1}{2} (c+d x)\right )\right )}{a^4 d} \\ & = \frac {2 b^4 \arctan \left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{a^4 \sqrt {a-b} \sqrt {a+b} d}-\frac {b \left (a^2+2 b^2\right ) \text {arctanh}(\sin (c+d x))}{2 a^4 d}+\frac {\left (2 a^2+3 b^2\right ) \tan (c+d x)}{3 a^3 d}-\frac {b \sec (c+d x) \tan (c+d x)}{2 a^2 d}+\frac {\sec ^2(c+d x) \tan (c+d x)}{3 a d} \\ \end{align*}
Time = 1.83 (sec) , antiderivative size = 258, normalized size of antiderivative = 1.64 \[ \int \frac {\sec ^4(c+d x)}{a+b \cos (c+d x)} \, dx=\frac {-\frac {24 b^4 \text {arctanh}\left (\frac {(a-b) \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {-a^2+b^2}}\right )}{\sqrt {-a^2+b^2}}+\frac {1}{2} \sec ^3(c+d x) \left (9 b \left (a^2+2 b^2\right ) \cos (c+d x) \left (\log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )-\log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )\right )+3 b \left (a^2+2 b^2\right ) \cos (3 (c+d x)) \left (\log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )-\log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )\right )+4 a \left (4 a^2+3 b^2-3 a b \cos (c+d x)+\left (2 a^2+3 b^2\right ) \cos (2 (c+d x))\right ) \sin (c+d x)\right )}{12 a^4 d} \]
[In]
[Out]
Time = 1.53 (sec) , antiderivative size = 252, normalized size of antiderivative = 1.61
method | result | size |
derivativedivides | \(\frac {-\frac {1}{3 a \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )^{3}}-\frac {-a -b}{2 a^{2} \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )^{2}}-\frac {2 a^{2}+a b +2 b^{2}}{2 a^{3} \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}-\frac {b \left (a^{2}+2 b^{2}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{2 a^{4}}+\frac {2 b^{4} \arctan \left (\frac {\left (a -b \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{\sqrt {\left (a -b \right ) \left (a +b \right )}}\right )}{a^{4} \sqrt {\left (a -b \right ) \left (a +b \right )}}-\frac {1}{3 a \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )^{3}}-\frac {a +b}{2 a^{2} \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )^{2}}-\frac {2 a^{2}+a b +2 b^{2}}{2 a^{3} \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}+\frac {b \left (a^{2}+2 b^{2}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{2 a^{4}}}{d}\) | \(252\) |
default | \(\frac {-\frac {1}{3 a \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )^{3}}-\frac {-a -b}{2 a^{2} \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )^{2}}-\frac {2 a^{2}+a b +2 b^{2}}{2 a^{3} \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}-\frac {b \left (a^{2}+2 b^{2}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{2 a^{4}}+\frac {2 b^{4} \arctan \left (\frac {\left (a -b \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{\sqrt {\left (a -b \right ) \left (a +b \right )}}\right )}{a^{4} \sqrt {\left (a -b \right ) \left (a +b \right )}}-\frac {1}{3 a \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )^{3}}-\frac {a +b}{2 a^{2} \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )^{2}}-\frac {2 a^{2}+a b +2 b^{2}}{2 a^{3} \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}+\frac {b \left (a^{2}+2 b^{2}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{2 a^{4}}}{d}\) | \(252\) |
risch | \(\frac {i \left (3 a b \,{\mathrm e}^{5 i \left (d x +c \right )}+6 b^{2} {\mathrm e}^{4 i \left (d x +c \right )}+12 a^{2} {\mathrm e}^{2 i \left (d x +c \right )}+12 b^{2} {\mathrm e}^{2 i \left (d x +c \right )}-3 a b \,{\mathrm e}^{i \left (d x +c \right )}+4 a^{2}+6 b^{2}\right )}{3 a^{3} d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{3}}+\frac {b \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )}{2 a^{2} d}+\frac {b^{3} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )}{a^{4} d}-\frac {b^{4} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+\frac {i a^{2}-i b^{2}+a \sqrt {-a^{2}+b^{2}}}{b \sqrt {-a^{2}+b^{2}}}\right )}{\sqrt {-a^{2}+b^{2}}\, d \,a^{4}}+\frac {b^{4} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-\frac {i a^{2}-i b^{2}-a \sqrt {-a^{2}+b^{2}}}{b \sqrt {-a^{2}+b^{2}}}\right )}{\sqrt {-a^{2}+b^{2}}\, d \,a^{4}}-\frac {b \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )}{2 a^{2} d}-\frac {b^{3} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )}{a^{4} d}\) | \(343\) |
[In]
[Out]
none
Time = 0.40 (sec) , antiderivative size = 535, normalized size of antiderivative = 3.41 \[ \int \frac {\sec ^4(c+d x)}{a+b \cos (c+d x)} \, dx=\left [-\frac {6 \, \sqrt {-a^{2} + b^{2}} b^{4} \cos \left (d x + c\right )^{3} \log \left (\frac {2 \, a b \cos \left (d x + c\right ) + {\left (2 \, a^{2} - b^{2}\right )} \cos \left (d x + c\right )^{2} + 2 \, \sqrt {-a^{2} + b^{2}} {\left (a \cos \left (d x + c\right ) + b\right )} \sin \left (d x + c\right ) - a^{2} + 2 \, b^{2}}{b^{2} \cos \left (d x + c\right )^{2} + 2 \, a b \cos \left (d x + c\right ) + a^{2}}\right ) + 3 \, {\left (a^{4} b + a^{2} b^{3} - 2 \, b^{5}\right )} \cos \left (d x + c\right )^{3} \log \left (\sin \left (d x + c\right ) + 1\right ) - 3 \, {\left (a^{4} b + a^{2} b^{3} - 2 \, b^{5}\right )} \cos \left (d x + c\right )^{3} \log \left (-\sin \left (d x + c\right ) + 1\right ) - 2 \, {\left (2 \, a^{5} - 2 \, a^{3} b^{2} + 2 \, {\left (2 \, a^{5} + a^{3} b^{2} - 3 \, a b^{4}\right )} \cos \left (d x + c\right )^{2} - 3 \, {\left (a^{4} b - a^{2} b^{3}\right )} \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{12 \, {\left (a^{6} - a^{4} b^{2}\right )} d \cos \left (d x + c\right )^{3}}, \frac {12 \, \sqrt {a^{2} - b^{2}} b^{4} \arctan \left (-\frac {a \cos \left (d x + c\right ) + b}{\sqrt {a^{2} - b^{2}} \sin \left (d x + c\right )}\right ) \cos \left (d x + c\right )^{3} - 3 \, {\left (a^{4} b + a^{2} b^{3} - 2 \, b^{5}\right )} \cos \left (d x + c\right )^{3} \log \left (\sin \left (d x + c\right ) + 1\right ) + 3 \, {\left (a^{4} b + a^{2} b^{3} - 2 \, b^{5}\right )} \cos \left (d x + c\right )^{3} \log \left (-\sin \left (d x + c\right ) + 1\right ) + 2 \, {\left (2 \, a^{5} - 2 \, a^{3} b^{2} + 2 \, {\left (2 \, a^{5} + a^{3} b^{2} - 3 \, a b^{4}\right )} \cos \left (d x + c\right )^{2} - 3 \, {\left (a^{4} b - a^{2} b^{3}\right )} \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{12 \, {\left (a^{6} - a^{4} b^{2}\right )} d \cos \left (d x + c\right )^{3}}\right ] \]
[In]
[Out]
\[ \int \frac {\sec ^4(c+d x)}{a+b \cos (c+d x)} \, dx=\int \frac {\sec ^{4}{\left (c + d x \right )}}{a + b \cos {\left (c + d x \right )}}\, dx \]
[In]
[Out]
Exception generated. \[ \int \frac {\sec ^4(c+d x)}{a+b \cos (c+d x)} \, dx=\text {Exception raised: ValueError} \]
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 286 vs. \(2 (140) = 280\).
Time = 0.34 (sec) , antiderivative size = 286, normalized size of antiderivative = 1.82 \[ \int \frac {\sec ^4(c+d x)}{a+b \cos (c+d x)} \, dx=-\frac {\frac {12 \, {\left (\pi \left \lfloor \frac {d x + c}{2 \, \pi } + \frac {1}{2} \right \rfloor \mathrm {sgn}\left (-2 \, a + 2 \, b\right ) + \arctan \left (-\frac {a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{\sqrt {a^{2} - b^{2}}}\right )\right )} b^{4}}{\sqrt {a^{2} - b^{2}} a^{4}} + \frac {3 \, {\left (a^{2} b + 2 \, b^{3}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right )}{a^{4}} - \frac {3 \, {\left (a^{2} b + 2 \, b^{3}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right )}{a^{4}} + \frac {2 \, {\left (6 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 3 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 6 \, b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 4 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 12 \, b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 6 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 3 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 6 \, b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1\right )}^{3} a^{3}}}{6 \, d} \]
[In]
[Out]
Time = 17.28 (sec) , antiderivative size = 991, normalized size of antiderivative = 6.31 \[ \int \frac {\sec ^4(c+d x)}{a+b \cos (c+d x)} \, dx=\text {Too large to display} \]
[In]
[Out]